package com.esiag.loadbalancer.main;

import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;

import com.esiag.loadbalancer.impl.LoadBalancer;

public class LoadBalancingTest {
	public static Logger logger = Logger.getLogger("LoadBalancingTest");

	public static void main(String[] args) {
		FileHandler fileHandler;
		
		try {
			fileHandler = new FileHandler("GhitahJabri.log");
			logger.addHandler( fileHandler);
			SimpleFormatter formatter = new SimpleFormatter();  
            fileHandler.setFormatter(formatter); 
            LoadBalancer<Entity, String> loadBalancer = new LoadBalancer<Entity, String>();
            loadBalancer.getSubscriber().subscribe(new Entity("Composant 1"));
            loadBalancer.getSubscriber().subscribe(new Entity("Composant 2"));
            loadBalancer.getSubscriber().subscribe(new Entity("Composant 3"));
            loadBalancer.getSubscriber().subscribe(new Entity("Composant 4"));
	    		
            new InfoGenerator(loadBalancer.getNotifier());
		
		} catch (Exception e) {
			logger.log(Level.OFF, e.getMessage());
		}
	}
	}

